﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace WarehouseManagement.BusinessLogic.DTO
{
   

    public partial class CurrencyExchangeRateDTO : INotifyPropertyChanging, INotifyPropertyChanged
    {

        private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

        private System.Guid _Id;

        private int _CurrencyId;

        private System.DateTime _Date;

        private decimal _ExchangeRateInVND;

        

        #region Extensibility Method Definitions
        partial void OnLoaded();
        partial void OnValidate(System.Data.Linq.ChangeAction action);
        partial void OnCreated();
        partial void OnIdChanging(System.Guid value);
        partial void OnIdChanged();
        partial void OnCurrencyIdChanging(int value);
        partial void OnCurrencyIdChanged();
        partial void OnDateChanging(System.DateTime value);
        partial void OnDateChanged();
        partial void OnExchangeRateInVNDChanging(decimal value);
        partial void OnExchangeRateInVNDChanged();
        #endregion

        public CurrencyExchangeRateDTO()
        {
            
            OnCreated();
        }

        public System.Guid Id
        {
            get
            {
                return this._Id;
            }
            set
            {
                if ((this._Id != value))
                {
                    this.OnIdChanging(value);
                    this.SendPropertyChanging();
                    this._Id = value;
                    this.SendPropertyChanged("Id");
                    this.OnIdChanged();
                }
            }
        }

        public int CurrencyId
        {
            get
            {
                return this._CurrencyId;
            }
            set
            {
                if ((this._CurrencyId != value))
                {
                    
                    this.OnCurrencyIdChanging(value);
                    this.SendPropertyChanging();
                    this._CurrencyId = value;
                    this.SendPropertyChanged("CurrencyId");
                    this.OnCurrencyIdChanged();
                }
            }
        }

        public System.DateTime Date
        {
            get
            {
                return this._Date;
            }
            set
            {
                if ((this._Date != value))
                {
                    this.OnDateChanging(value);
                    this.SendPropertyChanging();
                    this._Date = value;
                    this.SendPropertyChanged("Date");
                    this.OnDateChanged();
                }
            }
        }

        public decimal ExchangeRateInVND
        {
            get
            {
                return this._ExchangeRateInVND;
            }
            set
            {
                if ((this._ExchangeRateInVND != value))
                {
                    this.OnExchangeRateInVNDChanging(value);
                    this.SendPropertyChanging();
                    this._ExchangeRateInVND = value;
                    this.SendPropertyChanged("ExchangeRateInVND");
                    this.OnExchangeRateInVNDChanged();
                }
            }
        }

       

        public event PropertyChangingEventHandler PropertyChanging;

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void SendPropertyChanging()
        {
            if ((this.PropertyChanging != null))
            {
                this.PropertyChanging(this, emptyChangingEventArgs);
            }
        }

        protected virtual void SendPropertyChanged(String propertyName)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
